package com.neusoft.neuiotms.dcvm.task.cmdbSyn.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcvm.task.cmdbSyn.model.CmdbSynSrcData;
import com.neusoft.neuiotms.dcvm.task.cmdbSyn.model.CmdbSynSrcDataLast;

@Component
public class CmdbSynSrcDataToLastConverter extends AbstractConverter<CmdbSynSrcData, CmdbSynSrcDataLast> {

    @Override
    public CmdbSynSrcData toModel(final CmdbSynSrcDataLast dto) {
        final CmdbSynSrcData cmdbSynSrcData = new CmdbSynSrcData();
        BeanUtils.copyProperties(dto, cmdbSynSrcData);
        return cmdbSynSrcData;
    }

    @Override
    public CmdbSynSrcDataLast toDTO(final CmdbSynSrcData model, final boolean forListView) {
        final CmdbSynSrcDataLast dto = new CmdbSynSrcDataLast();
        BeanUtils.copyProperties(model, dto);
        return dto;
    }

}
